import request from '@/utils/request'

// 获取班次下拉列表-新
export function getClassesListNew() {
  return request({
    url: '/operation/web/schedules/listClasses',
    method: 'get'
  })
}

// 获取班次下拉列表
export function getClassesList() {
  return request({
    url: '/operation/web/schedules/classesList',
    method: 'get'
  })
}

// 获取用户下拉列表
export function getUserList() {
  return request({
    url: '/operation/web/schedules/userList',
    method: 'get'
  })
}

// 获取周期类型下拉列表
export function getCycleTypeList() {
  return request({
    url: '/operation/web/schedules/cycleType',
    method: 'get'
  })
}

// 查询排班管理列表
export function getScheduleList(params) {
  return request({
    url: '/operation/web/schedules/list',
    method: 'get',
    params
  })
}

// 获取排班管理详细信息
export function getScheduleDetail(id) {
  return request({
    url: `/operation/web/schedules/${id}`,
    method: 'get'
  })
}

// 新增排班管理
export function addSchedule(data) {
  return request({
    url: '/operation/web/schedules',
    method: 'post',
    data
  })
}

// 修改排班管理
export function updateSchedule(data) {
  return request({
    url: '/operation/web/schedules',
    method: 'put',
    data
  })
}

// 删除排班管理
export function deleteSchedule(ids) {
  return request({
    url: `/operation/web/schedules/${ids}`,
    method: 'delete'
  })
}

// 审核通过
export function approveSchedule(id) {
  return request({
    url: `/operation/web/schedules/solve/${id}`,
    method: 'get'
  })
}

// 审核驳回
export function rejectSchedule(id) {
  return request({
    url: `/operation/web/schedules/rejection/${id}`,
    method: 'get'
  })
}

// 状态已完成
export function completeSchedule(id) {
  return request({
    url: `/operation/web/schedules/end/${id}`,
    method: 'get'
  })
}